﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> - 数据表格</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="${pageContext.request.contextPath }/shoppingadmin/favicon.ico"> 
    <link href="${pageContext.request.contextPath }/shoppingadmin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="${pageContext.request.contextPath }/shoppingadmin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <!-- Data Tables -->
    <link href="${pageContext.request.contextPath }/shoppingadmin/css/dataTables.bootstrap.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath }/shoppingadmin/css/animate.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath }/shoppingadmin/css/style.css?v=4.1.0" rel="stylesheet">
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>广告位  列表</h5>
                        
                        <div class="ibox-tools">
								<a href="${pageContext.request.contextPath }/shoppingadmin/message_edit.jsp">
                        		 <button type="button" class="btn btn-default btn-xs">添加</button>
                        	</a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <table class="table table-striped table-bordered table-hover dataTables-example">
                            <thead>                
                                <tr>
                                	<th>图片</th>
                                   
                                    <th>类别</th>
                                    <th>标题</th>
                                    <th>内容</th>
                                   
                                    <th style="text-align: center;">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                            	<c:forEach var="list" items="${Advertisinglist }">
                            	
                            	<tr class="gradeX">
                                    <td><img src="${pageContext.request.contextPath }/shoppingadmin/images/advertisimg/${list.advertisingphonto}" alt="加载中。。" style="height: 58px;width: 180px;"></td>
                                    <td>${list.land.two_name }</td>
                                   
                                    <td>
                                    	 ${list.advertisingTotal }
                                    </td>
                                    <td>${list.advertisingcontent }</td>
                                   
                                    <td style="text-align: center;">
                                    	<a class="btn btn-white btn-bitbucket" title="编辑" href="${pageContext.request.contextPath }/Advertis/seladvertisingByid.html?avid=${list.advertisingId }">
                           					<i class="fa fa-pencil-square-o" aria-hidden="true"></i>
                        				</a>
                        			    <input type="hidden" value="20"/>
                        				<a class="btn btn-white btn-bitbucket delete" title="删除"  href="${pageContext.request.contextPath }/Advertis/deladvertisings.html/${list.advertisingId }">
                           					 <i class="fa fa-trash-o" aria-hidden="true" ></i>
                        				</a>
                        			</td>
                                </tr>
                            	
                            	</c:forEach>
                            	
                            	
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 全局js -->
    <script src="${pageContext.request.contextPath }/shoppingadmin/js/jquery.min.js?v=2.1.4"></script>
    <script src="${pageContext.request.contextPath }/shoppingadmin/js/bootstrap.min.js?v=3.3.6"></script>


    <script src="${pageContext.request.contextPath }/shoppingadmin/js/jquery.jeditable.js"></script>

    <!-- Data Tables -->
    <script src="${pageContext.request.contextPath }/shoppingadmin/js/jquery.dataTables.js"></script>
    <script src="${pageContext.request.contextPath }/shoppingadmin/js/dataTables.bootstrap.js"></script>

    <!-- 自定义js -->
    <script src="${pageContext.request.contextPath }/shoppingadmin/js/content.js?v=1.0.0"></script>

    <!-- Page-Level Scripts -->
    <script>
	    $(document).ready(function () {
	    	$(".delete").click(function () {
	    		var id=$(this).prev().val();
	    		if(confirm("确定删除吗？删除后将无法恢复！")){
	    			window.location.href="admin_message_del.action?message.id="+id;
	    			return true;
	    		}else{
	    			return false;
	    		}
	        });	
	    });
	    
        $(document).ready(function () {
            $('.dataTables-example').dataTable();

            /* Init DataTables */
            var oTable = $('#editable').dataTable();

            /* Apply the jEditable handlers to the table */
            oTable.$('td').editable('../example_ajax.php', {
                "callback": function (sValue, y) {
                    var aPos = oTable.fnGetPosition(this);
                    oTable.fnUpdate(sValue, aPos[0], aPos[1]);
                },
                "submitdata": function (value, settings) {
                    return {
                        "row_id": this.parentNode.getAttribute('id'),
                        "column": oTable.fnGetPosition(this)[2]
                    };
                },

                "width": "90%",
                "height": "100%"
            });


        });

        function fnClickAddRow() {
            $('#editable').dataTable().fnAddData([
                "Custom row",
                "New row",
                "New row",
                "New row",
                "New row"]);

        }
    </script>
</body>

</html>
